package com.tender.desensitization.factory.field;

import com.tender.desensitization.annotations.FieldDecryptionTag;

import java.lang.reflect.Field;

public class FieldDecryptionTagStringDetectionFactory implements FieldAnnotationDetectionFactory {

    private FieldAnnotationDetectionFactoryFacade factoryFacade;

    public FieldDecryptionTagStringDetectionFactory(FieldAnnotationDetectionFactoryFacade factoryFacade) {
        this.factoryFacade = factoryFacade;
    }

    @Override
    public boolean supports(Class<?> clazz) {
        return String.class.isAssignableFrom(clazz) && String.class == clazz;
    }

    @Override
    public boolean processType(Field field) {
        return null != field.getAnnotation(FieldDecryptionTag.class);
    }
}